<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>{{msg}}</h3>
        <h3>{{methodfn()}}</h3>
        <h3>{{computedmsg}}</h3>
        <h3>{{num}}</h3>
        <button @click="add">add</button>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                msg:"我是消息",
                num:0
            },
            methods: {
                methodfn(){
                    console.log("函数消息")
                    return this.msg+"函数消息"
                },
                add(){
                    this.num++
                }
            },
            computed: {
                computedmsg(){
                    console.log("属性计算消息")
                    return this.msg+"属性计算消息"
                }
            },
        })
    </script>
    
</body>
</html>